package com.cq.hd.member.api;

import com.cq.hd.common.pagination.Page;
import com.cq.hd.common.response.Result;
import com.cq.hd.member.api.dto.MyMerchantBusinessPageDto;
import com.cq.hd.member.api.dto.UpdateBusinessMerchantOrderDto;
import com.cq.hd.member.api.vo.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "hd-o2o-member-service", contextId = "business-merchant-api")
public interface TbBusinessMerchantApi {

    // 根据商家id，获取商家自有商户关联数据
    @GetMapping("/member/businessMerchant/getOwnByBusinessId")
    Result<BusinessMerchantVo> getOwnByBusinessId(@RequestParam("businessId") Long businessId, @RequestParam("ownState") Integer ownState);

    // 我的策划人分页条件列表
    @GetMapping("/member/businessMerchant/pageMyBusiness")
    Result<Page<MyMerchantBusinessPageVo>> pageMyBusiness(@SpringQueryMap MyMerchantBusinessPageDto myMerchantBusinessPageDto);

    // 我的策划人分页条件列表
    @GetMapping("/member/businessMerchant/listMyBusiness")
    Result<List<MyMerchantBusinessPageVo>> listMyBusiness(@SpringQueryMap MyMerchantBusinessPageDto myMerchantBusinessPageDto);

    // 根据商家id，获取商户数据
    @GetMapping("/member/businessMerchant/listMerchantByBusinessId")
    Result<List<MerchantPageVo>> listMerchantByBusinessId(@RequestParam("businessId") Long businessId);

    // 更新商家与商户相关的统计字段
    @PostMapping("/member/businessMerchant/updateBusinessMerchantOrder")
    Result<Boolean> updateBusinessMerchantOrder(@RequestBody UpdateBusinessMerchantOrderDto updateBusinessMerchantOrderDto);

    // 根据商家id批量获取商家自有商户数据数据
    @PostMapping("/member/businessMerchant/listOwnMerchantByBusinessIds")
    Result<List<BusinessMerchantVo>> listOwnMerchantByBusinessIds(@RequestBody List<Long> businessIds);

    // 根据自有商户id查询对应的商家列表
    @PostMapping("/member/businessMerchant/listMasterBusinessByMerchantIds")
    Result<List<MasterBusinessVo>> listMasterBusinessByMerchantIds(@RequestBody List<Long> merchantIds);

}
